package com.china.produce.factorys.audio;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2023/6/14
 */
@Service
public class AliAudioRequestFactoryBean implements EnvironmentAware, FactoryBean<AliAudioRequestFactory> {

    private String prefix;

    @Override
    public AliAudioRequestFactory getObject() throws Exception {
        return new AliAudioRequestFactory(prefix);
    }

    @Override
    public Class<?> getObjectType() {
        return AliAudioRequestFactory.class;
    }

    @Override
    public void setEnvironment(Environment environment) {
        this.prefix = environment.getProperty("audio.ali.prefix");
    }
}
